package vn.fpt.fsoft.entities;

import java.sql.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * @author MinhNC7
 * 
 */
@Entity
@Table(name = "Premise")
public class Premise implements java.io.Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -8558091352800186533L;
	private int premiseID;
	private Service service;
	private String locationName;
	private String knownAs;
	private int locationOrg;
	private String status;
	private Date locationDate;
	private boolean locManaged;
	private boolean primaryLocation;
	private boolean stNetConnect;
	private String type;
	private String description;
	private String phone;
	private String fax;
	private String minicomNumber;
	private boolean isNewShop;
	private Set<PremiseOutreach> premiseOutreach = new HashSet<PremiseOutreach>(
			0);
	private Set<PremiseRate> premiseRate = new HashSet<PremiseRate>(0);
	private Set<PreJCPOffices> preJCPOffice = new HashSet<PreJCPOffices>(0);
	private Set<OpeningTime> openingTime = new HashSet<OpeningTime>(0);

	@Id
	@Column(name = "Premiseid", unique = true, nullable = false)
	public int getPremiseID() {
		return premiseID;
	}

	public void setPremiseID(int premiseID) {
		this.premiseID = premiseID;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ServiceId", nullable = true)
	public Service getService() {
		return service;
	}

	public void setService(Service service) {
		this.service = service;
	}

	@Column(name = "LocationName", length = 50, nullable = true)
	public String getLocationName() {
		return locationName;
	}

	public void setLocationName(String locationName) {
		this.locationName = locationName;
	}

	@Column(name = "KnownAs", length = 50, nullable = true)
	public String getKnownAs() {
		return knownAs;
	}

	public void setKnownAs(String knownAs) {
		this.knownAs = knownAs;
	}

	@Column(name = "LocationOrganisation", length = 50, nullable = true)
	public int getLocationOrg() {
		return locationOrg;
	}

	public void setLocationOrg(int locationOrg) {
		this.locationOrg = locationOrg;
	}

	@Column(name = "LocationStatus")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name = "LocationDate")
	public Date getLocationDate() {
		return locationDate;
	}

	public void setLocationDate(Date locationDate) {
		this.locationDate = locationDate;
	}

	@Column(name = "LocationManaged")
	public boolean isLocManaged() {
		return locManaged;
	}

	public void setLocManaged(boolean locManaged) {
		this.locManaged = locManaged;
	}

	@Column(name = "PrimaryLocation")
	public boolean isPrimaryLocation() {
		return primaryLocation;
	}

	public void setPrimaryLocation(boolean primaryLocation) {
		this.primaryLocation = primaryLocation;
	}

	@Column(name = "STNetworkConnect")
	public boolean isStNetConnect() {
		return stNetConnect;
	}

	public void setStNetConnect(boolean stNetConnect) {
		this.stNetConnect = stNetConnect;
	}

	@Column(name = "LocationType", length = 20, nullable = true)
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Column(name = "Phone", length = 15, nullable = true)
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "Description", length = 200, nullable = true)
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "Fax", length = 15, nullable = true)
	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	@Column(name = "MinicomNumber", length = 20, nullable = true)
	public String getMinicomNumber() {
		return minicomNumber;
	}

	public void setMinicomNumber(String minicomNumber) {
		this.minicomNumber = minicomNumber;
	}

	@Column(name = "IsNewShop")
	public boolean isNewShop() {
		return isNewShop;
	}

	public void setNewShop(boolean isNewShop) {
		this.isNewShop = isNewShop;
	}

	public Premise() {
	};

	public Premise(int premiseID, Service service, String locationName,
			String knownAs, int locationOrg, String status, Date locationDate,
			boolean locManaged, boolean primaryLocation, boolean stNetConnect,
			String type, String description, String phone, String fax,
			String minicomNumber, boolean isNewShop) {
		this.premiseID = premiseID;
		this.service = service;
		this.locationName = locationName;
		this.knownAs = knownAs;
		this.locationOrg = locationOrg;
		this.status = status;
		this.locationDate = locationDate;
		this.locManaged = locManaged;
		this.primaryLocation = primaryLocation;
		this.stNetConnect = stNetConnect;
		this.type = type;
		this.description = description;
		this.phone = phone;
		this.fax = fax;
		this.minicomNumber = minicomNumber;
		this.isNewShop = isNewShop;
	}
	@OneToMany(fetch=FetchType.LAZY, mappedBy ="premise")
	public Set<PremiseOutreach> getPremiseOutreach() {
		return premiseOutreach;
	}

	public void setPremiseOutreach(Set<PremiseOutreach> premiseOutreach) {
		this.premiseOutreach = premiseOutreach;
	}
	@OneToMany(fetch=FetchType.LAZY, mappedBy ="premise")
	public Set<PremiseRate> getPremiseRate() {
		return premiseRate;
	}

	public void setPremiseRate(Set<PremiseRate> premiseRate) {
		this.premiseRate = premiseRate;
	}
	@OneToMany(fetch=FetchType.LAZY, mappedBy ="premise")
	public Set<PreJCPOffices> getPreJCPOffice() {
		return preJCPOffice;
	}
	@OneToMany(fetch=FetchType.LAZY, mappedBy ="premise")
	public void setPreJCPOffice(Set<PreJCPOffices> preJCPOffice) {
		this.preJCPOffice = preJCPOffice;
	}
	@OneToMany(fetch=FetchType.LAZY, mappedBy ="premise")
	public Set<OpeningTime> getOpeningTime() {
		return openingTime;
	}

	public void setOpeningTime(Set<OpeningTime> openingTime) {
		this.openingTime = openingTime;
	}

}
